package com.nttuan.model.entity;

import android.util.Log;

import org.json.JSONObject;

/**
 * Created by NT Tuan on 10/20/2014.
 */
public class Location {
    private  static  final String TAG ="location entity";

    public static final String TABLE_NAME = "location";
    public static final String LOCATION_ID = "locationId";
    public static final String ADDRESS = "address";
    public static final String LOG_LAG = "log_lag";
    public static final String NOTE = "note";
    public static final String IS_ACTIVE = "isActive";

    private int locationId;
    private String address;
    private String log_lag;
    private  String note;
    private boolean isActive;
    public static JSONObject jLocation(Location location){
        try {
            JSONObject object = new JSONObject();
            object.put(ADDRESS, location.getAddress());
            object.put(LOG_LAG, location.getLog_lag());
            JSONObject result = new JSONObject();
            result.put(TABLE_NAME, object);
            return result;
        }catch (Exception e){
            Log.d(TAG, "jLocation:" + e.toString());
        }
        return null;
    }
    public Location(){}
    public Location(int locationId, String address, String log_lag, String note, boolean isActive) {
        this.locationId = locationId;
        this.address = address;
        this.log_lag = log_lag;
        this.note = note;
        this.isActive = isActive;
    }

    public Location(int locationId,String address) {
        this.locationId = locationId;
        this.address = address;
    }

    public int getLocationId() {
        return locationId;
    }

    public void setLocationId(int locationId) {
        this.locationId = locationId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLog_lag() {
        return log_lag;
    }

    public void setLog_lag(String log_lag) {
        this.log_lag = log_lag;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public boolean isActive() {
        return isActive;
    }

    public void setActive(boolean isActive) {
        this.isActive = isActive;
    }
}
